﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.ServiceBroker.Configuration
{
    /// <summary>
    /// Endpoint setting class...
    /// </summary>
    /// <seealso cref="System.Configuration.ConfigurationElement" />
    public class Endpoint : ConfigurationElement
    {
        /// <summary>
        /// Gets or sets the connection string.
        /// </summary>
        /// <value>
        /// The connection string for connects to the service bus endpoint...
        /// </value>
        [ConfigurationProperty("connectionString", IsRequired = true, IsKey = false)]
        public string ConnectionString
        {
            get { return (string)base["connectionString"]; }
            set { base["connectionString"] = value; }
        }

        /// <summary>
        /// Gets or sets the name...
        /// </summary>
        /// <value>
        /// The name of the endpoint...
        /// </value>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get { return (string)base["name"]; }
            set { base["name"] = value; }
        }

        /// <summary>
        /// Gets or sets the subscriptions.
        /// </summary>
        /// <value>
        /// The subscriptions.
        /// </value>
        [ConfigurationProperty("Subscriptions", IsDefaultCollection = true)]
        public Subscriptions Subscriptions
        {
            get { return ((Subscriptions)(base["Subscriptions"])); }
            set { base["Subscriptions"] = value; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Endpoint"/> class.
        /// </summary>
        public Endpoint()
        {
        }
    }
}
